function hierarchyPrecision(hierarchy){
  if(trim(hierarchy["genus"]).length>1&&trim(hierarchy["specificEpithet"]).length>1&&trim(hierarchy["infraspecificEpithet"]).length>1){
    return 8;
  }
  if(trim(hierarchy["genus"]).length>1&&trim(hierarchy["specificEpithet"]).length>1){
    return 7;
  }
  if(trim(hierarchy["genus"]).length>1){
    return 6;
  }
  if(trim(hierarchy["family"]).length>1){
    return 5;
  }
  if(trim(hierarchy["order"]).length>1){
    return 4;
  }
  if(trim(hierarchy["class"]).length>1){
    return 3;
  }
  if(trim(hierarchy["phylum"]).length>1){
    return 2;
  }
  if(trim(hierarchy["kingdom"]).length>1){
    return 1;
  }
  return 0;
}